#pragma once
#include <iostream>
#include <gl\freeglut.h>
#include "Item.h"
#include "Mouse.h"
#include "Achievement.h"

#include "loadTGA.h"

#include "FreeType.h"

using namespace std;

#define HEIGHT 600
#define WIDTH 800

#define QUICKSLOT 40
#define INVSIZE 30

class Inventory
{
private:
			int				row, column;
			Item			**slots;

			bool			draw;
			MouseInfo		*mouseInfo;

			TextureImage	IconTexture;
			TextureImage	*ItemTexture;
public:
			Inventory		(void);
			Inventory		(int row, int column);
			~Inventory		(void);

	freetype::font_data		inventory_font,quick_font;

	void	Print			(void);
	void	SetMouseInfo	(MouseInfo *mouseInfo);

	bool	GetDraw			(void);
	void	SetDraw			(bool draw);

	void	UpdateInventory	(void);
	void	RenderInventory	(void);

	int		ReturnRow		(void);
	int		ReturnColumn	(void);
	//return Item Number from inventory;
	int		ReturnInventory	(int row, int column);

	//Set slot of inventory to a certain item
	void	SetInventory	(int X, int Y, Item item);

	//Add item into the next available slot in the inventory
	bool	AddItem			(Item item);

	//Check if Inventory have this amount of this item
	bool	CheckItem		(Item::no itemNum,int quantity);
	int		CheckQuantity	(Item::no itemNum);

	//Always do a CheckItem function before removing;
	void	RemoveItem		(Item::no itemNum,int quantity);

	//Remove all quest type item after the quest
	void	RemoveQuestItem	(void);

	//Reset the inventory to set every thing to empty
	void	ResetInventory	(void);
};
